

<%@ page import="com.surelution.projects.echo.domain.PredefineMessage" %>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <resource:richTextEditor type="advanced" />
        <g:set var="entityName" value="${predefineMessageInstance?.code}" />
        <g:if test="${predefineMessageInstance?.code=='FOOT_MESSAGE' }">
	       <title><g:message code="default.edit.label1" args="[entityName]" /></title>
        </g:if>
        <g:if test="${predefineMessageInstance?.code == 'POST_SCRIPT' }">
	       <title><g:message code="default.edit.label2" args="[entityName]" /></title>
        </g:if>
        <%--<title><g:message code="default.edit.label" args="[entityName]" /></title>--%>
    </head>
    <body>
       <sec:ifLoggedIn>
        <div class="nav" >
            <span class="menuButton"><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></span>
				<div   style='float: right'>
				当前用户：<sec:username />&nbsp;&nbsp;<g:link controller="user">修改密码</g:link>&nbsp;<g:link controller="logout">退出</g:link>
				</div>
       	</div>
       </sec:ifLoggedIn>
        <div class="body">
        <g:if test="${predefineMessageInstance?.code=='FOOT_MESSAGE' }">
	       <h1><g:message code="default.edit.label1" args="[entityName]" /></h1>
        </g:if>
        <g:if test="${predefineMessageInstance?.code == 'POST_SCRIPT' }">
	       <h1><g:message code="default.edit.label2" args="[entityName]" /></h1>
        </g:if>
            <%--<h1><g:message code="default.edit.label" args="[entityName]" /></h1>--%>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
            <g:hasErrors bean="${predefineMessageInstance}">
            <div class="errors">
                <g:renderErrors bean="${predefineMessageInstance}" as="list" />
            </div>
            </g:hasErrors>
            <g:form method="post" >
                <g:hiddenField name="id" value="${predefineMessageInstance?.id}" />
                <g:hiddenField name="version" value="${predefineMessageInstance?.version}" />
                <div class="dialog">
                    <table>
                        <tbody>
                        <g:hiddenField name="code" value="${predefineMessageInstance?.code}" />
                        
                            <tr class="prop">
                                <td valign="top" class="value ${hasErrors(bean: predefineMessageInstance, field: 'content', 'errors')}">
                                    <richui:richTextEditor name="content" value="${predefineMessageInstance?.content}" width="450"/>
                                </td>
                            </tr>
                        
                        </tbody>
                    </table>
                </div>
                <div class="buttons">
                    <span class="button"><g:actionSubmit class="save" action="update" value="${message(code: 'default.button.update.label', default: 'Update')}" /></span>
                </div>
            </g:form>
        </div>
    </body>
</html>
